// Recover fatigue much faster when resting

private ["_fatigue","_newFatigue","_recoverVar"];
_fatigue = getFatigue player;
_newFatigue = _fatigue;

while {true} do {
	private ["_result","_animState","_animStateChars","_animP"];
    _animState = animationState player;
    _animStateChars = toArray _animState;
    _animP = toUpper (toString [_animStateChars select 5,_animStateChars select 6,_aniMStateChars select 7]);
    _result = "UP";
    switch (_animP) do {
        case "ERC": {_recoverVar = 0};
        case "KNL": {_recoverVar = 0.015};
        case "PNE": {_recoverVar = 0.1};
        default {_recoverVar = 0};
    };
	_fatigue = getFatigue player;
	if (_fatigue > _recoverVar) then {
		_newFatigue = (_fatigue - _recoverVar);
	} else {
		_newFatigue = 0;
	};
	player setFatigue _newFatigue;
	sleep 1;
};